<?php
function smarty_function_explode($params, &$smarty)
{
	if (isset($params['default'])) {
		$tmp = explode($params["separator"], $params["string"]);
	} else {
		$array = explode($params["separator"], $params["string"]);
		$tmp = array();
		if (count($array) > 0){
			foreach ($array as $key=>$value){
				if (strlen($value) > 0) $tmp[$value] = $value;
			}
		}
		unset($array);
	}
	if (isset($params["assign"])) $smarty->assign($params["assign"], $tmp);
	else return $array;
}
?>
